<template>
  <link rel="stylesheet" type="text/css" href="/assets/css/my.css" />
  <div class="usercenter">
    <div class="header">
      <div class="header_title">
        <div class="title_avatar">
          <img :src="business.avatar_text" alt="" />
        </div>
        <div class="title_content">
          <div class="content_text">{{ business.nickname }}</div>
          <div class="content_sm">{{ business.createtime_text }}</div>
        </div>
      </div>
      <div class="operate">
        <div class="text-sm">
          <span class="text-bold">0</span>
          收藏夹
        </div>
        <div class="text-sm">
          <span class="text-bold">0</span>
          关注店铺
        </div>
        <div class="text-sm">
          <span class="text-bold">0</span>
          足迹
        </div>
        <div class="text-sm">
          <span class="text-bold">0</span>
          全部订单
        </div>
      </div>
    </div>
    <div class="userorder">
      <div class="order_project">
        <div class="item">
          <router-link to="/order/index" class="item">
            <div class="img">
              <img src="/assets/images/order1.png" alt="" />
            </div>
            全部订单
          </router-link>
        </div>
        <div class="item">
          <a href="order.html" class="item">
            <div class="img">
              <img src="/assets/images/order2.png" alt="" />
            </div>
            待发货
          </a>
        </div>
        <div class="item">
          <a href="order.html" class="item">
            <div class="img">
              <img src="/assets/images/order3.png" alt="" />
            </div>
            待收货
          </a>
        </div>
        <div class="item">
          <a href="order.html" class="item">
            <div class="img">
              <img src="/assets/images/order4.png" alt="" />
            </div>
            待评价
          </a>
        </div>
        <div class="item solid-left">
          <a href="order.html" class="item">
            <div class="img">
              <img src="/assets/images/returns.png" alt="" />
            </div>
            退货/售后
          </a>
        </div>
      </div>
    </div>
    <div class="userorder">
      <div class="order_project">
        <div class="item">
          <router-link to="/business/retail" class="item">
            <div class="img">
              <img src="/assets/images/retail1.png" alt="" />
            </div>
            分销信息
          </router-link>
        </div>
        <div class="item">
          <router-link to="/business/businessteam"  class="item">
            <div class="img">
              <img src="/assets/images/retail2.png" alt="" />
            </div>
            分销会员
          </router-link>
        </div>
        <div class="item">
          <router-link to="/business/kickback" class="item">
            <div class="img">
              <img src="/assets/images/retail3.png" alt="" />
            </div>
            分销佣金
          </router-link>
        </div>
        <!-- 优惠列表 -->
        <div class="item">
          <router-link to="/business/mycoupon" class="item">
            <div class="img">
              <img src="/assets/images/coupon.png" alt="" />
            </div>
            优惠列表
          </router-link>
        </div>
        <!-- 充值中心 -->
        <div class="item solid-left">
          <router-link to="/business/deposit" class="item">
            <div class="img">
              <img src="/assets/images/recharge2.png" alt="" />
            </div>
            充值中心
          </router-link>
        </div>
      </div>
    </div>
    <div class="usertool">
      <div class="list">
        <div class="item">
          <router-link to="/business/profile">
            <div class="img">
              <img src="/assets/images/profile.png" alt="" />
            </div>
            基本资料
          </router-link>
        </div>
        <div class="item">
          <a href="order.html">
            <div class="img">
              <img src="/assets/images/pingtuan.png" alt="" />
            </div>
            拼团订单
          </a>
        </div>
        <!-- 收货地址 -->
        <div class="item">
          <router-link to="/address/index">
            <div class="img">
              <img src="/assets/images/address.png" alt="" />
            </div>
            收货地址
          </router-link>
        </div>
        <div class="item">
          <!-- 已认证 -->
          <van-badge :content="5" color="#1989fa" position="top-right" v-if="business.auth">
            <router-link to="/business/email">
              <div class="img">
                <img src="/assets/images/email.png" alt="" />
              </div>
            </router-link>
            <template #content>
              <van-icon name="success" class="badge-icon" />
            </template>
          </van-badge>
          <!-- 未认证 -->
          <router-link to="/business/email" v-else>
              <div class="img">
                <img src="/assets/images/email.png" alt="" />
              </div>
            </router-link>
          邮箱认证
        </div>
        <div class="item">
          <router-link to="/business/record">
            <div class="img">
              <img src="/assets/images/consume.png" alt="" />
            </div>
            消费记录
          </router-link>
        </div>
        <div class="item">
          <a href="record.html">
            <div class="img">
              <img src="/assets/images/recharge1.png" alt="" />
            </div>
            充值记录
          </a>
        </div>
        <div class="item">
          <a @click="logout">
            <div class="img">
              <img src="/assets/images/returns.png" alt="" />
            </div>
            退出登录
          </a>
        </div>
      </div>
    </div>
    <div class="usertool">
      <ul class="proul">
        <li>
          <a href="detail.html"><img src="/assets/images/7.jpg" /></a>
          <a href="detail.html"
            ><p class="tit">
              北欧轻奢餐椅家用现代简约新中式洽谈酒店皮革软包餐厅椅子靠背椅
            </p></a
          >
          <div class="price">
            <p>￥2998</p>
          </div>
        </li>
        <li>
          <a href="detail.html"><img src="/assets/images/4.jpg" /></a>
          <a href="detail.html"
            ><p class="tit">
              松兰宾利实木餐桌椅组合后现代轻奢长方形大户型不锈钢8人饭桌
            </p></a
          >
          <div class="price">
            <p>￥998</p>
          </div>
        </li>
        <li>
          <a href="detail.html"><img src="/assets/images/5.jpg" /></a>
          <a href="detail.html"
            ><p class="tit">
              卫生间洗手台柜面池洗睑台式壁挂台盆架瓷盥洗池饭店小号挂盆经济
            </p></a
          >
          <div class="price">
            <p>￥368</p>
          </div>
        </li>
        <li>
          <a href="detail.html"><img src="/assets/images/6.jpg" /></a>
          <a href="detail.html"
            ><p class="tit">
              布艺床主卧大床双人床港式轻奢ins网红床卧室北欧家具床现代简约
            </p></a
          >
          <div class="price">
            <p>￥3998</p>
          </div>
        </li>
      </ul>
    </div>
    <div class="h54"></div>
    <div class="clear"></div>
  </div>
  <div class="footerBox">
    <div class="footer">
      <ul>
        <li class="on">
          <a href="index.html">
            <img src="/assets/images/f01.png" />
            <p>首页</p>
          </a>
        </li>
        <li>
          <a href="typelist.html">
            <img src="/assets/images/f2.png" />
            <p>分类</p>
          </a>
        </li>
        <li>
          <a href="find.html">
            <img src="/assets/images/faxian.png" />
            <p>发现</p>
          </a>
        </li>
        <li>
          <a href="gwc.html">
            <img src="/assets/images/f3.png" />
            <p>购物车</p>
          </a>
        </li>
        <li>
          <a href="my.html">
            <img src="/assets/images/f4.png" />
            <p>我的</p>
          </a>
        </li>
      </ul>
    </div>
  </div>

  <tabbar />
</template>
<script setup>
import tabbar from "@/components/common/tabbar.vue";

const { proxy } = getCurrentInstance();

const business = proxy.$business.value;
business.auth = business.auth == '1' ? true : false;

const logout = () => {
  proxy.$confirm({
      message: "是否确认退出",
    })
    .then(() => {
      //确认
      //删除cookie，跳转
      proxy.$cookies.remove("business");
      proxy.$router.push("/business/login");
    })
    .catch(() => {});
};
</script>